<template>
     <el-button type="primary" @click="add">主要按钮</el-button><br>
     <span>{{count}}</span><br>
    <el-button type="primary" @click="countAdd">store</el-button><br>
     <span>{{storeCount}}</span><br>
     <svg class="icon" aria-hidden="true">
    <use xlink:href="#icon-cartfill"></use>
</svg>
     <div style="height:900px"></div>
</template>

<script lang="ts">
import { ref, defineComponent,computed } from 'vue'
import {useStore} from 'vuex'
export default defineComponent({
  name: 'Test',
  setup: () => {
    const count = ref(0)
     const store = useStore()
     const storeCount=computed(()=>store.state.count)
    const add=()=>{count.value++}
    return { count,add,storeCount,countAdd:()=>store.commit('increment') }
  }
})
</script>

<style lang="scss">

</style>